<?php

/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
class CommonController extends Controller{
    public $layout=false;
    /**
	 * @return array action filters
	 */
	public function filters()
	{
		return array(
            //自定义授权方式
            'accessAuth',
		);
	}
    
    public function filterAccessAuth($filterChain) {  
        if(Yii::app()->user->getIsGuest() && !in_array($this->getAction()->getId(), $this->authlessActions())) {  
            Yii::app()->user->loginRequired();
        }  
        $filterChain->run();  
    }  
    
    public function authlessActions() {  
        return array(
			'skin'
		); 
    }  
    
    public function actionSkin(){
        $this->render('skin');
    }
}
